import type { LcdTheme } from '@/api/modules/lcd/theme';
import type { FormProps, Rule } from 'ant-design-vue/es/form';
import type { FormHTMLAttributes } from 'vue';

const formObj: LcdTheme = {
  themeId: '',
  themeName: '',
  themeBoard: '',
  deptId: null,
  background: '',
  image: [],
  scale: 0,
  imgSrc: '',
  category: '',
  share: '0',
  major: '0',
};
export const form = ref<LcdTheme>({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<keyof LcdTheme, Rule[]> = {
  themeId: [],
  themeName: [{ required: true }],
  themeBoard: [],
  deptId: [],
  width: [{ required: true }],
  height: [{ required: true }],
  background: [],
  image: [],
  scale: [],
  imgSrc: [],
  category: [{ required: true }],
  share: [{ required: true }],
  major: [],
  sizeId: [{ required: true }],
};
